package com.xl.yygh.cmn.client;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author XiangLiang
 * @date 2023/10/26 14:39
 * @description
 */
@FeignClient("service-cmn")
@Repository
public interface DictFeignClient {
    /**
     * 根据字典code和value获取字典name
     * @param parentDictCode 字典code
     * @param value 字典value值
     * @return 字典name
     */
    @ApiOperation(value = "根据字典code和value获取字典name")
    @GetMapping(value = "/admin/cmn/dict/getName/{parentDictCode}/{value}")
    public String getName(@PathVariable("parentDictCode") String parentDictCode,
                          @PathVariable("value") String value);

    /**
     * 根据value获取字典name
     * @param value 字典value值
     * @return 字典name
     */
    @ApiOperation(value = "根据value获取字典name")
    @GetMapping(value = "/admin/cmn/dict/getName/{value}")
    public String getName(@PathVariable("value") String value);
}
